SyntaxHighlighter.defaults.gutter = false;
SyntaxHighlighter.defaults.toolbar = false;
SyntaxHighlighter.all();

function addEvents(divs) {
    for(var i=0; i < divs.length; i++) {
        divs[i].innerHTML = i;
        divs[i].onclick = function() { alert(i) }
    }
}

window.addEventListener("load", function () {
    var cnt = document.getElementById("example01");
    if (cnt) {
        console.log("ok");
        addEvents(cnt.getElementsByTagName("span"));
    }
}, true);

/**
 * @class Customer
 *
 * @constructor
 *
 * @param {String} name
 * @param {Number} age
 * */
function Customer(name, age) {

    /** @memberOf Customer*/
    this.name = name;
    this.age = age || 18;
}

/**
 * @memberOf Customer
 *
 * @return Number
 * */
Customer.prototype.getAge = function () {
    return this.age;
};

/**
 * @memberOf Customer
 * 
 * @param age
 */
Customer.prototype.setAge = function (age) {
    age = age || age;
    this.age = age;
};

/**
 * @class Book
 *
 * @constructor {String} name
 *
 * @param {String} name
 * @param {Customer} author
 * */
function Book(name, author) {
    this.name = name;
    this.authorName = author.name;
}

function collectLinks() {
    var links = document.getElementsByTagName("a");
    var res = "";
    for (var i = 0; i < links.length; i++) {
        res += "  * [" + decodeURI(links[i].href) + " " + links[i].innerHTML + "]\n";
    }
    console.log(res);
}